using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Rally_Dekstop
{
    public partial class frmTestCaseFilters : Form
    {
        public frmTestCaseFilters()
        {
            InitializeComponent();
            Utilities.GetWorkspaceSpecifics("TestResult");
            Utilities.GetWorkspaceSpecifics("TestCase");

            this.cmb_LastRes.Items.Add("None");
            this.cmb_Priority.Items.Add("None");
            this.cmb_Type.Items.Add("None");

            foreach (string res in RallyDesk.CURRENTWORKSPACE.WorkSpaceSpecifics.TestResult.Verdicts)
                this.cmb_LastRes.Items.Add(res);

            foreach (string pri in RallyDesk.CURRENTWORKSPACE.WorkSpaceSpecifics.TestCase.Priority)
                this.cmb_Priority.Items.Add(pri);
            
            foreach (string typ in RallyDesk.CURRENTWORKSPACE.WorkSpaceSpecifics.TestCase.Types)
                this.cmb_Type.Items.Add(typ);

        }

        private void frmTestCaseFilters_Load(object sender, EventArgs e)
        {
           

        }

        public string[] Display(string[] args )
        {
            this.cmb_Priority.SelectedItem = args[0] as string;
            this.cmb_LastRes.SelectedItem = args[1] as string;
            this.cmb_Type.SelectedItem = args[2] as string;

            if (this.ShowDialog() == DialogResult.OK)
            {
                string[] returnArray = {cmb_Priority.Text, cmb_LastRes.Text,cmb_Type.Text};
                return returnArray;
            }
            else
            {
                return args;
            }
       }
    }
}